<template>
  <div class="container">
    <div class="flex flex-wrap f-ptp10">
      <el-select class='f-mrt20 f-mbt10 f-w120' v-model="vip" clearable placeholder="请选择">
        <el-option
          v-for="item in options"
          :key="item.value"
          :label="item.label"
          :value="item.value">
        </el-option>
      </el-select>
      <el-input class='f-mrt20 f-mbt10 f-w120' v-model="phone" placeholder="案件编号"></el-input>
      <el-select class='f-mrt20 f-mbt10 f-w120' v-model="vip" clearable placeholder="请选择">
        <el-option
          v-for="item in options"
          :key="item.value"
          :label="item.label"
          :value="item.value">
        </el-option>
      </el-select>
      <el-input class='f-mrt20 f-mbt10 f-w120' v-model="createTime" placeholder="发布时间开始-结束"></el-input>
      <el-input class='f-mrt20 f-mbt10 f-w120' v-model="createTime" placeholder="用户id"></el-input>
      <el-input class='f-mrt20 f-mbt10 f-w120' v-model="createTime" placeholder="用户手机"></el-input>
      <el-select class='f-mrt20 f-mbt10 f-w120' v-model="vip" clearable placeholder="请选择">
        <el-option
          v-for="item in options"
          :key="item.value"
          :label="item.label"
          :value="item.value">
        </el-option>
      </el-select>
      <el-button class='f-h40' @click="search" type="primary">查询</el-button>
      <el-button class='f-h40' @click="dialogVisible = true" type="primary">新增招标</el-button>
    </div>
    <div>
      <el-table
        :data="tableData"
        border
        style="width: 100%">
        <el-table-column prop="issueType" label="案件编号" width="180"></el-table-column>
        <el-table-column prop="phone" label="案件类型" width="180"></el-table-column>
        <el-table-column prop="region" label="地区" width="180"></el-table-column>
        <el-table-column prop="region" label="用户ID" width="180"></el-table-column>
        <el-table-column prop="region" label="用户手机" width="180"></el-table-column>
        <el-table-column prop="content" label="案件详情" width="120">
          <template slot-scope="scope">
            <span @click="showBtnClickEvent(scope.$index, scope.row)" class='s-c-green f-csp'>查看</span>
          </template>
        </el-table-column>
        <el-table-column prop="createTime" label="发布时间" width="180"></el-table-column>
        <el-table-column prop="manage" label="管理">
          <template slot-scope="scope">
            <span @click="biddingBtnClickEvent(scope.$index, scope.row)" class='s-c-green f-csp'>招标中</span>
          </template>
        </el-table-column>
      </el-table>
      <div>
        <el-pagination
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :current-page.sync="currentPage1"
          :page-size="100"
          layout="total, prev, pager, next"
          :total="1000">
        </el-pagination>
      </div>
    </div>

    <!-- dialog -->
    <el-dialog
      title="新增招标"
      :visible.sync="dialogVisible"
      width="560px"
      :before-close="handleClose">
      <div class='dialog-item f-oh'>
        <label class='f-fl' for="">用户ID</label>
        <div class='f-fl dialog-right'>
          <el-input class='f-w200' v-model="createTime" placeholder="输入用户id"></el-input>
        </div>
      </div>
      <div class='dialog-item'>
        <label for="">用户手机</label>
        <div class='dialog-right'>
          <el-input class='f-w200' v-model="createTime" placeholder="输入用户id"></el-input>
        </div>
      </div>
      <div class='dialog-item'>
        <label for="">案件地区</label>
        <div class='dialog-right'>
          <el-select class='f-w200' v-model="vip" clearable placeholder="请选择">
            <el-option
              v-for="item in options"
              :key="item.value"
              :label="item.label"
              :value="item.value">
            </el-option>
          </el-select>
        </div>
      </div>
      <div class='dialog-item'>
        <label for="">案件类型</label>
        <div class='dialog-right'>
          <el-select class='f-w200' v-model="vip" clearable placeholder="请选择">
            <el-option
              v-for="item in options"
              :key="item.value"
              :label="item.label"
              :value="item.value">
            </el-option>
          </el-select>
        </div>
      </div>
      <div class='dialog-item'>
        <label for="">案件详情</label>
        <div class='dialog-right full'>
          <el-input
            type="textarea"
            :rows="6"
            placeholder="请输入内容"
            v-model="textarea">
          </el-input>
        </div>
      </div>
      <div class='dialog-footer'>
        <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
        <el-button @click="dialogVisible = false">取 消</el-button>
      </div>
    </el-dialog>

    <el-dialog
      title="案件详情"
      :visible.sync="showDetial"
      center
      width="560px">
      <span>这是一段信息</span>
      <span slot="footer" class="dialog-footer">
        <el-button @click="showDetial = false">取 消</el-button>
        <el-button type="primary" @click="showDetial = false">确 定</el-button>
      </span>
    </el-dialog>

    <el-dialog
      title="招标中案件"
      :visible.sync="showBidding"
      center
      width="800px">
      <div>
        <div>
          <span class='f-mrt10'>案件类型：房产纠纷</span>
          <span class='f-mrt10'>案件地区：浙江  杭州</span>
          <span>用户手机：15268086502</span>
        </div>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button @click="showBidding = false">取 消</el-button>
        <el-button type="primary" @click="showBidding = false">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
export default {
  name: 'BiddingManage',
  data() {
    return {
      dialogVisible: false,
      showDetial: false,
      showBidding: false,
      phone: '',
      password: '',
      tableData: [
        {
          userCode: '2016-05-02',
          phone: '18098758888',
          name: '王小虎',
          idCard: '330326199908080606',
          accountBalance: 5000.00,
          vip: 1,
          createTime: '2018-12-30'
        }, {
          date: '2016-05-04',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1517 弄'
        }, {
          date: '2016-05-01',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1519 弄'
        }, {
          date: '2016-05-03',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1516 弄'
        }
      ]
    }
  },
  methods: {
    showBtnClickEvent(index, row) {
      console.log('index:::', index);
      console.log('row:::', row);
      this.showDetial = true;
    },
    biddingBtnClickEvent(index, row) {
      console.log('index:::', index);
      console.log('row:::', row);
      this.showBidding = true;
    }
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
.dialog-item{
  overflow: hidden;
  padding-bottom: 10px;
}
.dialog-item>label{
  width: 65px;
  line-height: 40px;
  text-align: right;
  float: left;
}
.dialog-item .dialog-right{
  padding: 0 20px;
  float: left;
}
.dialog-footer{
  padding-left: 85px;
  padding-top: 20px;
}
.full{
  width: 450px;
}
</style>
